package com.sxhuayuan.parking.controller.member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sxhuayuan.parking.compenent.web.RespMessage;
import com.sxhuayuan.parking.entity.ParkingLot;
import com.sxhuayuan.parking.service.ParkChannelService;
import com.sxhuayuan.parking.service.ParkingLotService;

/** 第三方车场 */
@RestController
@RequestMapping("/member/parkinglot")
public class ParkingLotController extends BaseController {

	@Autowired
	ParkingLotService lotService;
	@Autowired
	ParkChannelService exitService;

	/**
	 * 当前车场信息
	 * 
	 * @param sn
	 * @return
	 */
	@RequestMapping("/get")
	public RespMessage get(String sn) {
		ParkingLot parkingLot = lotService.findBySn(getLotSnFromSession());
		if (parkingLot == null)
			return RespMessage.validError();
		parkingLot.setApiKey(null);
		parkingLot.setApiUrl(null);
		parkingLot.setApiUser(null);
		parkingLot.setMchid(null);
		parkingLot.setMchkey(null);
		parkingLot.setAgent(null);
		parkingLot.setId(null);
		return RespMessage.builder().success().setDatas(parkingLot).build();

	}
}
